package com.RMP
{
    import com.util.*;
    import flash.display.*;
    import flash.events.*;
    import com.greensock.*;

    public class ProjectShell extends Sprite
    {
        var subNavList:XMLList;
        var btnsArray:Array;
        var standardImgShell:ProjStandardImgShell;
        var colsArray:Array;
        var fadeSpeed:Number;
        var xmlLoader:XMLLoader;
        var subPos:int;
        var shortTitle:String;
        var projDescShell:ProjDescShell;
        var projId:int;
        var navList:XMLList;
        var hasSub:Boolean;
        var currSubNavId:int;
        var multiImgShell:ProjMultiImgShell;
        var projVidThumbShell:ProjVidThumbShell;
        var navListLength:int;
        var subBtnsArray:Array;
        var myRoot:MovieClip;
        var oldNavId:int;
        var currNavId:int;
        var oldSubNavId:int;
        var relatedShell:ProjRelatedShell;
        var bookmarkNavItem:BookmarkNavItem;
        var longText:LongText;
        public var myXML:XML;
        var shellsArray:Array;
        var navItem:NavItem;
        var subNavChildColList:XMLList;

        public function ProjectShell(param1:MovieClip, param2:Number, param3:int, param4:int, param5:int, param6:int) : void
        {
            myRoot = param1;
            fadeSpeed = param2;
            projId = param3;
            currNavId = param4;
            currSubNavId = param5;
            subPos = param6;
            xmlLoad();
            myRoot.stage.addEventListener(Event.RESIZE, onResizer, false, 0, true);
            doResize();
            return;
        }

        function switchNavs(param1:int) : void
        {
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            oldSubNavId = currSubNavId;
            currSubNavId = param1;
            _loc_2 = 0;
            while (_loc_2 < subBtnsArray.length)
            {
                
                if (_loc_2 == currSubNavId)
                {
                    TweenMax.to(subBtnsArray[_loc_2], fadeSpeed, {tint:myRoot.hotColor, alpha:1, overwrite:true});
                    if (colsArray[_loc_2] != undefined)
                    {
                        _loc_3 = 0;
                        while (_loc_3 < colsArray[_loc_2].length)
                        {
                            
                            colsArray[_loc_2][_loc_3].fadeInShellDelay();
                            _loc_3++;
                        }
                    }
                }
                else
                {
                    TweenMax.to(subBtnsArray[_loc_2], fadeSpeed, {tint:myRoot.coldColor, alpha:1, overwrite:true});
                    if (colsArray[_loc_2] != undefined)
                    {
                        _loc_3 = 0;
                        while (_loc_3 < colsArray[_loc_2].length)
                        {
                            
                            colsArray[_loc_2][_loc_3].fadeOutShell();
                            _loc_3++;
                        }
                    }
                }
                _loc_2++;
            }
            return;
        }

        function updateSubBookmark() : void
        {
            if (subBtnsArray[navListLength].inLightbox == true)
            {
                myRoot.removeFromBookmarks(projId, null);
                subBtnsArray[navListLength].field.text = "Bookmark +";
                subBtnsArray[navListLength].inLightbox = false;
            }
            else
            {
                myRoot.addToBookmarks(projId, null);
                subBtnsArray[navListLength].field.text = "Bookmark -";
                subBtnsArray[navListLength].inLightbox = true;
            }
            myRoot.updateBookmark();
            return;
        }

        function subBtnClick(event:MouseEvent) : void
        {
            trace("sub btn clickster");
            if (event.currentTarget.idNum == navListLength)
            {
                updateSubBookmark();
            }
            else
            {
                oldSubNavId = currSubNavId;
                currSubNavId = event.currentTarget.idNum;
                oldNavId = currNavId;
                currNavId = 0;
                updateAddress(currNavId);
            }
            return;
        }

        function subBtnRollOut(event:MouseEvent) : void
        {
            if (event.currentTarget.alpha == 1)
            {
                if (event.currentTarget.idNum != currSubNavId)
                {
                    TweenMax.to(event.currentTarget, fadeSpeed, {tint:myRoot.coldColor, overwrite:true});
                }
                if (event.currentTarget.idNum == navListLength)
                {
                    subBtnsArray[navListLength].field.text = "Bookmark";
                }
            }
            return;
        }

        function subBtnRollOver(event:MouseEvent) : void
        {
            if (event.currentTarget.alpha == 1)
            {
                if (event.currentTarget.idNum != currSubNavId)
                {
                    TweenMax.to(event.currentTarget, fadeSpeed, {tint:myRoot.overColor, overwrite:true});
                }
                else
                {
                    TweenMax.to(event.currentTarget, fadeSpeed, {tint:myRoot.hotColor, overwrite:true});
                }
                if (event.currentTarget.idNum == navListLength)
                {
                    if (subBtnsArray[navListLength].inLightbox == true)
                    {
                        subBtnsArray[navListLength].field.text = "Bookmark -";
                    }
                    else
                    {
                        subBtnsArray[navListLength].field.text = "Bookmark +";
                    }
                }
            }
            return;
        }

        function updateBookmark() : void
        {
            if (btnsArray[navListLength].inLightbox == true)
            {
                myRoot.removeFromBookmarks(projId, null);
                btnsArray[navListLength].field.text = "Bookmark +";
                btnsArray[navListLength].inLightbox = false;
            }
            else
            {
                myRoot.addToBookmarks(projId, null);
                btnsArray[navListLength].field.text = "Bookmark -";
                btnsArray[navListLength].inLightbox = true;
            }
            myRoot.updateBookmark();
            return;
        }

        function doResize() : void
        {
            var _loc_1:int = 0;
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            if (longText != null)
            {
                longText.x = Math.round(4 * (myRoot.unitW + myRoot.gutterW));
                longText.y = myRoot.headerH + (myRoot.unitH + myRoot.gutterH) - 4 * myRoot.unitW / 75;
                var _loc_4:* = myRoot.unitW / 75;
                longText.field.scaleY = myRoot.unitW / 75;
                longText.field.scaleX = _loc_4;
            }
            if (hasSub == true)
            {
                if (subBtnsArray != null)
                {
                    _loc_1 = 0;
                    while (_loc_1 < (subBtnsArray.length - 1))
                    {
                        
                        var _loc_4:* = myRoot.unitW / 75;
                        subBtnsArray[_loc_1].field.scaleY = myRoot.unitW / 75;
                        subBtnsArray[_loc_1].field.scaleX = _loc_4;
                        subBtnsArray[_loc_1].bg.width = myRoot.unitW;
                        subBtnsArray[_loc_1].bg.height = subBtnsArray[_loc_1].field.height;
                        subBtnsArray[_loc_1].x = Math.round(7 * (myRoot.unitW + myRoot.gutterW) - 3 * myRoot.unitW / 75);
                        subBtnsArray[_loc_1].y = Math.round(myRoot.headerH + (myRoot.unitH + myRoot.gutterH) + -5 * myRoot.unitW / 75 + 14 * _loc_1 * myRoot.unitW / 75);
                        if (subBtnsArray[_loc_1].field.text != "Related" && colsArray != null)
                        {
                            if (colsArray[_loc_1] != null)
                            {
                                _loc_2 = 0;
                                while (_loc_2 < colsArray[_loc_1].length)
                                {
                                    
                                    var _loc_4:* = myRoot.unitW / 75;
                                    colsArray[_loc_1][_loc_2].field.scaleY = myRoot.unitW / 75;
                                    colsArray[_loc_1][_loc_2].field.scaleX = _loc_4;
                                    colsArray[_loc_1][_loc_2].bg.width = myRoot.unitW;
                                    colsArray[_loc_1][_loc_2].bg.height = colsArray[_loc_1][_loc_2].field.height;
                                    colsArray[_loc_1][_loc_2].x = Math.round(9 * (myRoot.unitW + myRoot.gutterW) - 3 * myRoot.unitW / 75);
                                    colsArray[_loc_1][_loc_2].y = Math.round(myRoot.headerH + (myRoot.unitH + myRoot.gutterH) + -5 * myRoot.unitW / 75 + 14 * _loc_2 * myRoot.unitW / 75);
                                    _loc_2++;
                                }
                            }
                        }
                        _loc_1++;
                    }
                    var _loc_4:* = myRoot.unitW / 75;
                    subBtnsArray[(subBtnsArray.length - 1)].field.scaleY = myRoot.unitW / 75;
                    subBtnsArray[(subBtnsArray.length - 1)].field.scaleX = _loc_4;
                    subBtnsArray[(subBtnsArray.length - 1)].bg.width = myRoot.unitW;
                    subBtnsArray[(subBtnsArray.length - 1)].bg.height = subBtnsArray[(subBtnsArray.length - 1)].field.height;
                    subBtnsArray[(subBtnsArray.length - 1)].x = Math.round(4 * (myRoot.unitW + myRoot.gutterW));
                    subBtnsArray[(subBtnsArray.length - 1)].y = Math.round(myRoot.headerH + (myRoot.unitH + myRoot.gutterH) + -5 * myRoot.unitW / 75 + 14 * 7 * myRoot.unitW / 75);
                }
            }
            else if (btnsArray != null)
            {
                _loc_3 = 0;
                while (_loc_3 < (btnsArray.length - 1))
                {
                    
                    var _loc_4:* = myRoot.unitW / 75;
                    btnsArray[_loc_3].field.scaleY = myRoot.unitW / 75;
                    btnsArray[_loc_3].field.scaleX = _loc_4;
                    btnsArray[_loc_3].bg.width = myRoot.unitW;
                    btnsArray[_loc_3].bg.height = btnsArray[_loc_3].field.height;
                    btnsArray[_loc_3].x = Math.round(8 * (myRoot.unitW + myRoot.gutterW) - 3 * myRoot.unitW / 75);
                    btnsArray[_loc_3].y = Math.round(myRoot.headerH + (myRoot.unitH + myRoot.gutterH) + -5 * myRoot.unitW / 75 + 14 * _loc_3 * myRoot.unitW / 75);
                    _loc_3++;
                }
                var _loc_4:* = myRoot.unitW / 75;
                btnsArray[(btnsArray.length - 1)].field.scaleY = myRoot.unitW / 75;
                btnsArray[(btnsArray.length - 1)].field.scaleX = _loc_4;
                btnsArray[(btnsArray.length - 1)].bg.width = myRoot.unitW;
                btnsArray[(btnsArray.length - 1)].bg.height = btnsArray[(btnsArray.length - 1)].field.height;
                btnsArray[(btnsArray.length - 1)].x = Math.round(4 * (myRoot.unitW + myRoot.gutterW));
                btnsArray[(btnsArray.length - 1)].y = Math.round(myRoot.headerH + (myRoot.unitH + myRoot.gutterH) + -5 * myRoot.unitW / 75 + 14 * 7 * myRoot.unitW / 75);
            }
            return;
        }

        function createNewSubShell(param1:int, param2:int) : void
        {
            var incomingSubId:* = param1;
            var incomingNavId:* = param2;
            if (navList[incomingSubId] != "Related")
            {
                switch(colsArray[incomingSubId][incomingNavId].field.text)
                {
                    case "Info":
                    {
                        myRoot.menuShell.hRule3On();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Info")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_4, myXML.project[incomingSubId].thumbnails.@main, false);
                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListenerSub, false, 0, true);
                        projDescShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = projDescShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Credits":
                    {
                        myRoot.menuShell.hRule3On();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Credits")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_4, myXML.project[incomingSubId].thumbnails.@main, false);
                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListenerSub, false, 0, true);
                        projDescShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = projDescShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Construction":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Construction")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        multiImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = multiImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Models":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Models")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        multiImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = multiImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Photography":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Photography")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        multiImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = multiImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Renderings":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Renderings")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        multiImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = multiImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Silkscreens":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Silkscreens")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        multiImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = multiImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Drawings":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Drawings")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        standardImgShell = new ProjStandardImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        standardImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = standardImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Sketches":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Sketches")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        standardImgShell = new ProjStandardImgShell(myRoot, fadeSpeed, _loc_4.image, myXML.project[0].@id);
                        standardImgShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = standardImgShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    case "Video":
                    {
                        myRoot.menuShell.hRule3Off();
                        var _loc_5:int = 0;
                        var _loc_6:* = myXML.project[incomingSubId].tier0.tier1;
                        var _loc_4:* = new XMLList("");
                        for each (_loc_7 in _loc_6)
                        {
                            
                            var _loc_8:* = _loc_6[_loc_5];
                            with (_loc_6[_loc_5])
                            {
                                if (@label == "Video")
                                {
                                    _loc_4[_loc_5] = _loc_7;
                                }
                            }
                        }
                        projVidThumbShell = new ProjVidThumbShell(myRoot, fadeSpeed, _loc_4.video);
                        projVidThumbShell.hasSub = true;
                        shellsArray[incomingSubId][incomingNavId] = projVidThumbShell;
                        shellsArray[incomingSubId][incomingNavId].alpha = 0;
                        addChild(shellsArray[incomingSubId][incomingNavId]);
                        doResize();
                        shellsArray[incomingSubId][incomingNavId].doResize();
                        shellsArray[incomingSubId][incomingNavId].fadeInShell();
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            else
            {
                var _loc_5:int = 0;
                var _loc_6:* = myXML.project[0].tier0.tier1;
                var _loc_4:* = new XMLList("");
                for each (_loc_7 in _loc_6)
                {
                    
                    var _loc_8:* = _loc_6[_loc_5];
                    with (_loc_6[_loc_5])
                    {
                        if (@label == "Related")
                        {
                            _loc_4[_loc_5] = _loc_7;
                        }
                    }
                }
                relatedShell = new ProjRelatedShell(myRoot, fadeSpeed, _loc_4.item);
                shellsArray[incomingSubId][incomingNavId] = relatedShell;
                shellsArray[incomingSubId][incomingNavId].alpha = 0;
                addChild(shellsArray[incomingSubId][incomingNavId]);
                doResize();
                shellsArray[incomingSubId][incomingNavId].fadeInShell();
            }
            return;
        }

        function xmlProgress(event:XMLProgressEvent) : void
        {
            return;
        }

        function btnRollOver(event:MouseEvent) : void
        {
            if (event.currentTarget.alpha == 1)
            {
                if (event.currentTarget.idNum != currNavId)
                {
                    TweenMax.to(event.currentTarget.field, fadeSpeed, {tint:myRoot.overColor, overwrite:true});
                }
                else
                {
                    TweenMax.to(event.currentTarget.field, fadeSpeed, {tint:myRoot.hotColor, overwrite:true});
                }
                if (event.currentTarget.idNum == navListLength)
                {
                    if (btnsArray[navListLength].inLightbox == true)
                    {
                        btnsArray[navListLength].field.text = "Bookmark -";
                    }
                    else
                    {
                        btnsArray[navListLength].field.text = "Bookmark +";
                    }
                }
            }
            return;
        }

        function buildLongTitle(param1:String) : void
        {
            longText = new LongText(myRoot, param1);
            longText.alpha = 0;
            addChild(longText);
            doResize();
            TweenMax.to(longText, fadeSpeed, {alpha:1, overwrite:true});
            return;
        }

        function toLowercase(param1:String) : String
        {
            var _loc_2:String = null;
            var _loc_3:* = undefined;
            _loc_2 = "";
            _loc_3 = 0;
            while (_loc_3 < param1.length)
            {
                
                if (param1.charAt(_loc_3) == " ")
                {
                    _loc_2 = _loc_2 + "-";
                }
                else
                {
                    _loc_2 = _loc_2 + param1.charAt(_loc_3).toLowerCase();
                }
                _loc_3 = _loc_3 + 1;
            }
            return _loc_2;
        }

        function onResizer(event:Event)
        {
            doResize();
            return;
        }

        public function switchShells(param1:int) : void
        {
            var btnsArrayLength:int;
            var i:int;
            var showBorder:Boolean;
            var incomingId:* = param1;
            myRoot.registerPageHit(myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + toLowercase(myXML.project[0].shortTitle) + "/" + toLowercase(btnsArray[incomingId].field.text));
            oldNavId = currNavId;
            currNavId = incomingId;
            btnsArrayLength = btnsArray.length;
            if (navList[oldNavId] == "Info" && navList[currNavId] == "Credits" || navList[oldNavId] == "Credits" && navList[currNavId] == "Info")
            {
                trace("switcheroo");
                i;
                while (i < btnsArrayLength)
                {
                    
                    if (i == currNavId)
                    {
                        TweenMax.to(btnsArray[i].field, fadeSpeed, {tint:myRoot.hotColor, alpha:1, overwrite:true});
                        if (shellsArray[i] != undefined)
                        {
                            shellsArray[i].image.alpha = 1;
                            shellsArray[i].fadeOutCoverSprite();
                        }
                        else
                        {
                            if (shellsArray[oldNavId].image != null)
                            {
                                incomingId = i;
                                switch(String(navList[incomingId]))
                                {
                                    case "Info":
                                    {
                                        if (myXML.project.thumbnails.@mBorder == "1")
                                        {
                                            showBorder;
                                        }
                                        else
                                        {
                                            showBorder;
                                        }
                                        var _loc_4:int = 0;
                                        var _loc_5:* = myXML.project.tier0.tier1;
                                        var _loc_3:* = new XMLList("");
                                        for each (_loc_6 in _loc_5)
                                        {
                                            
                                            var _loc_7:* = _loc_5[_loc_4];
                                            with (_loc_5[_loc_4])
                                            {
                                                if (@label == "Info")
                                                {
                                                    _loc_3[_loc_4] = _loc_6;
                                                }
                                            }
                                        }
                                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_3, myXML.project.thumbnails.@main, showBorder, shellsArray[oldNavId].image);
                                        if (!navList.contains("Photography") && !navList.contains("Renderings") && !navList.contains("Models") && !navList.contains("Sketches") && !navList.contains("Drawings") && !navList.contains("Construction") && !navList.contains("Video"))
                                        {
                                            projDescShell.showBtn = false;
                                        }
                                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListener, false, 0, true);
                                        shellsArray[incomingId] = projDescShell;
                                        shellsArray[incomingId].alpha = 0;
                                        addChild(shellsArray[incomingId]);
                                        doResize();
                                        shellsArray[incomingId].fadeInShell();
                                        break;
                                    }
                                    case "Credits":
                                    {
                                        if (myXML.project.thumbnails.@mBorder == "1")
                                        {
                                            showBorder;
                                        }
                                        else
                                        {
                                            showBorder;
                                        }
                                        var _loc_4:int = 0;
                                        var _loc_5:* = myXML.project.tier0.tier1;
                                        var _loc_3:* = new XMLList("");
                                        for each (_loc_6 in _loc_5)
                                        {
                                            
                                            var _loc_7:* = _loc_5[_loc_4];
                                            with (_loc_5[_loc_4])
                                            {
                                                if (@label == "Credits")
                                                {
                                                    _loc_3[_loc_4] = _loc_6;
                                                }
                                            }
                                        }
                                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_3, myXML.project.thumbnails.@main, showBorder, shellsArray[oldNavId].image);
                                        if (!navList.contains("Photography") && !navList.contains("Renderings") && !navList.contains("Models") && !navList.contains("Sketches") && !navList.contains("Drawings") && !navList.contains("Construction") && !navList.contains("Video"))
                                        {
                                            projDescShell.showBtn = false;
                                        }
                                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListener, false, 0, true);
                                        shellsArray[incomingId] = projDescShell;
                                        shellsArray[incomingId].alpha = 0;
                                        addChild(shellsArray[incomingId]);
                                        doResize();
                                        shellsArray[incomingId].fadeInShell();
                                        break;
                                    }
                                    default:
                                    {
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                createNewShell(i);
                            }
                            shellsArray[i].fadeInBitmap = false;
                            shellsArray[i].fadeOutCoverSprite();
                        }
                    }
                    else
                    {
                        TweenMax.to(btnsArray[i].field, fadeSpeed, {tint:myRoot.coldColor, alpha:1, overwrite:true});
                        if (shellsArray[i] != undefined)
                        {
                            if (i == oldNavId)
                            {
                                shellsArray[i].fadeInCoverSprite();
                            }
                            else
                            {
                                shellsArray[i].fadeOutShell();
                            }
                        }
                    }
                    i = (i + 1);
                }
            }
            else
            {
                i;
                while (i < btnsArrayLength)
                {
                    
                    if (i == currNavId)
                    {
                        TweenMax.to(btnsArray[i].field, fadeSpeed, {tint:myRoot.hotColor, alpha:1, overwrite:true});
                        if (shellsArray[i] != undefined)
                        {
                            shellsArray[i].visible = true;
                            if (navList[currNavId] == "Credits" || navList[currNavId] == "Info")
                            {
                                shellsArray[i].coverSprite.visible = false;
                                shellsArray[i].coverSprite.alpha = 0;
                            }
                            shellsArray[i].fadeInShell();
                        }
                        else
                        {
                            createNewShell(i);
                        }
                    }
                    else
                    {
                        TweenMax.to(btnsArray[i].field, fadeSpeed, {tint:myRoot.coldColor, alpha:1, overwrite:true});
                        if (shellsArray[i] != undefined)
                        {
                            shellsArray[i].fadeOutShell();
                        }
                    }
                    i = (i + 1);
                }
            }
            return;
        }

        function toUppercase(param1:String) : String
        {
            var _loc_2:String = null;
            var _loc_3:* = undefined;
            _loc_2 = "";
            _loc_3 = 0;
            while (_loc_3 < param1.length)
            {
                
                if (param1.charAt(_loc_3) == "-")
                {
                    _loc_2 = _loc_2 + " ";
                }
                else if (_loc_3 == 0 || param1.charAt((_loc_3 - 1)) == "-")
                {
                    _loc_2 = _loc_2 + param1.charAt(_loc_3).toUpperCase();
                }
                else
                {
                    _loc_2 = _loc_2 + param1.charAt(_loc_3).toLowerCase();
                }
                _loc_3 = _loc_3 + 1;
            }
            return _loc_2;
        }

        function btnRollOut(event:MouseEvent) : void
        {
            if (event.currentTarget.alpha == 1)
            {
                if (event.currentTarget.idNum != currNavId)
                {
                    TweenMax.to(event.currentTarget.field, fadeSpeed, {tint:myRoot.coldColor, overwrite:true});
                }
                if (event.currentTarget.idNum == navListLength)
                {
                    btnsArray[navListLength].field.text = "Bookmark";
                }
            }
            return;
        }

        public function switchChildShells(param1:int, param2:int, param3:Boolean = false) : void
        {
            var i:int;
            var incomingId:int;
            var showBorder:Boolean;
            var colsArrayLength:int;
            var subId:* = param1;
            var currId:* = param2;
            var fromDeepLink:* = param3;
            if (fromDeepLink == true)
            {
                oldSubNavId = currSubNavId;
                oldNavId = currNavId;
                currSubNavId = subId;
                currNavId = currId;
            }
            switchNavs(currSubNavId);
            i;
            trace("--------------------");
            if (navList[currSubNavId] != "Related" && currSubNavId == oldSubNavId && (colsArray[currSubNavId][oldNavId].field.text == "Info" && colsArray[currSubNavId][currNavId].field.text == "Credits" || colsArray[currSubNavId][oldNavId].field.text == "Credits" && colsArray[currSubNavId][currNavId].field.text == "Info"))
            {
                trace("switcheroo");
                i;
                while (i < colsArray[currSubNavId].length)
                {
                    
                    if (i == currNavId)
                    {
                        TweenMax.to(colsArray[currSubNavId][i].field, fadeSpeed, {tint:myRoot.hotColor, alpha:1, overwrite:true});
                        if (shellsArray[currSubNavId][i] != undefined)
                        {
                            shellsArray[currSubNavId][i].image.alpha = 1;
                            shellsArray[currSubNavId][i].fadeOutCoverSprite();
                        }
                        else
                        {
                            if (shellsArray[currSubNavId][oldNavId].image != null)
                            {
                                incomingId = i;
                                switch(colsArray[currSubNavId][currNavId].field.text)
                                {
                                    case "Info":
                                    {
                                        if (myXML.project[currSubNavId].thumbnails.@mBorder == "1")
                                        {
                                            showBorder;
                                        }
                                        else
                                        {
                                            showBorder;
                                        }
                                        var _loc_6:int = 0;
                                        var _loc_7:* = myXML.project[currSubNavId].tier0.tier1;
                                        var _loc_5:* = new XMLList("");
                                        for each (_loc_8 in _loc_7)
                                        {
                                            
                                            var _loc_9:* = _loc_7[_loc_6];
                                            with (_loc_7[_loc_6])
                                            {
                                                if (@label == "Info")
                                                {
                                                    _loc_5[_loc_6] = _loc_8;
                                                }
                                            }
                                        }
                                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_5, myXML.project[currSubNavId].thumbnails.@main, showBorder, shellsArray[currSubNavId][oldNavId].image);
                                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListenerSub, false, 0, true);
                                        projDescShell.hasSub = true;
                                        shellsArray[currSubNavId][currNavId] = projDescShell;
                                        shellsArray[currSubNavId][currNavId].alpha = 0;
                                        addChild(shellsArray[currSubNavId][currNavId]);
                                        doResize();
                                        shellsArray[currSubNavId][currNavId].doResize();
                                        shellsArray[currSubNavId][currNavId].fadeInShell();
                                        break;
                                    }
                                    case "Credits":
                                    {
                                        if (myXML.project[currSubNavId].thumbnails.@mBorder == "1")
                                        {
                                            showBorder;
                                        }
                                        else
                                        {
                                            showBorder;
                                        }
                                        myRoot.menuShell.hRule3On();
                                        var _loc_6:int = 0;
                                        var _loc_7:* = myXML.project[currSubNavId].tier0.tier1;
                                        var _loc_5:* = new XMLList("");
                                        for each (_loc_8 in _loc_7)
                                        {
                                            
                                            var _loc_9:* = _loc_7[_loc_6];
                                            with (_loc_7[_loc_6])
                                            {
                                                if (@label == "Credits")
                                                {
                                                    _loc_5[_loc_6] = _loc_8;
                                                }
                                            }
                                        }
                                        projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_5, myXML.project[currSubNavId].thumbnails.@main, showBorder, shellsArray[currSubNavId][oldNavId].image);
                                        projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListenerSub, false, 0, true);
                                        projDescShell.hasSub = true;
                                        shellsArray[currSubNavId][currNavId] = projDescShell;
                                        shellsArray[currSubNavId][currNavId].alpha = 0;
                                        addChild(shellsArray[currSubNavId][currNavId]);
                                        doResize();
                                        shellsArray[currSubNavId][currNavId].doResize();
                                        shellsArray[currSubNavId][currNavId].fadeInShell();
                                        break;
                                    }
                                    default:
                                    {
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                trace("right nere");
                                createNewShell(i);
                            }
                            shellsArray[currSubNavId][currNavId].fadeInBitmap = false;
                            shellsArray[currSubNavId][currNavId].fadeOutCoverSprite();
                        }
                    }
                    else
                    {
                        TweenMax.to(colsArray[currSubNavId][i].field, fadeSpeed, {tint:myRoot.coldColor, alpha:1, overwrite:true});
                        if (shellsArray[currSubNavId][i] != undefined)
                        {
                            if (i == oldNavId)
                            {
                                shellsArray[currSubNavId][i].fadeInCoverSprite();
                            }
                            else
                            {
                                shellsArray[currSubNavId][i].fadeOutShell();
                            }
                        }
                    }
                    i = (i + 1);
                }
            }
            else
            {
                trace("------------------------------");
                if (navList[currSubNavId] != "Related")
                {
                    myRoot.registerPageHit(myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + toLowercase(shortTitle) + "/" + toLowercase(subNavList[currSubNavId]) + "/" + toLowercase(colsArray[currSubNavId][currNavId].field.text));
                    colsArrayLength = colsArray[currSubNavId].length;
                    i;
                    while (i < colsArrayLength)
                    {
                        
                        if (i == currNavId)
                        {
                            TweenMax.to(colsArray[currSubNavId][i].field, fadeSpeed, {tint:myRoot.hotColor, alpha:1, overwrite:true});
                        }
                        else
                        {
                            TweenMax.to(colsArray[currSubNavId][i].field, fadeSpeed, {tint:myRoot.coldColor, alpha:1, overwrite:true});
                        }
                        i = (i + 1);
                    }
                }
                else
                {
                    myRoot.registerPageHit(myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + toLowercase(shortTitle) + "/" + "related");
                }
                loadChildShells(currSubNavId, currNavId);
            }
            return;
        }

        function imageBtnClickListenerSub(event:ImageBtnClickEvent) : void
        {
            var _loc_2:int = 0;
            var _loc_3:String = null;
            _loc_2 = 0;
            _loc_3 = "";
            _loc_2 = 0;
            while (_loc_2 < colsArray[currSubNavId].length)
            {
                
                _loc_3 = _loc_3 + colsArray[currSubNavId][_loc_2].field.text;
                _loc_2++;
            }
            if (_loc_3.indexOf("Photography"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Photography")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Sketches"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Sketches")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Drawings"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Drawings")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Models"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Models")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Renderings"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Renderings")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Construction"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Construction")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (_loc_3.indexOf("Video"))
            {
                _loc_2 = 0;
                while (_loc_2 < colsArray[currSubNavId].length)
                {
                    
                    if (colsArray[currSubNavId][_loc_2].field.text == "Video")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            return;
        }

        function buildSubNavChildCol(param1:XMLList) : Array
        {
            var _loc_2:int = 0;
            var _loc_3:* = undefined;
            var _loc_4:int = 0;
            _loc_2 = param1.length();
            _loc_3 = new Array();
            _loc_4 = 0;
            while (_loc_4 < _loc_2)
            {
                
                _loc_3[_loc_4] = new NavItem(myRoot, param1[_loc_4], "", _loc_4);
                _loc_3[_loc_4].addEventListener(MouseEvent.MOUSE_OVER, btnRollOver, false, 0, true);
                _loc_3[_loc_4].addEventListener(MouseEvent.MOUSE_OUT, btnRollOut, false, 0, true);
                _loc_3[_loc_4].addEventListener(MouseEvent.CLICK, childBtnClick, false, 0, true);
                _loc_3[_loc_4].alpha = 0;
                _loc_3[_loc_4].visible = false;
                addChild(_loc_3[_loc_4]);
                _loc_4++;
            }
            return _loc_3;
        }

        function xmlInit(event:XMLInitEvent) : void
        {
            var navList:XMLList;
            var e:* = event;
            myXML = e.myXML;
            if (myXML.project.length() > 1)
            {
                hasSub = true;
                buildLongTitle(myXML.project[0].longTitle);
                shortTitle = myXML.project[0].shortTitle;
                subNavList = new XMLList(myXML.project.shortTitle.text());
                var _loc_4:int = 0;
                var _loc_5:* = myXML.project[0].tier0.tier1;
                var _loc_3:* = new XMLList("");
                for each (_loc_6 in _loc_5)
                {
                    
                    var _loc_7:* = _loc_5[_loc_4];
                    with (_loc_5[_loc_4])
                    {
                        if (@label == "Related")
                        {
                            _loc_3[_loc_4] = _loc_6;
                        }
                    }
                }
                if (_loc_3 != undefined)
                {
                    subNavList[subNavList.length()] = "Related";
                }
                subNavList[0] = "Main";
                buildSubNav(subNavList);
                if (subPos != 0)
                {
                    trace("yee haw");
                    switchChildShells(currSubNavId, currNavId);
                }
                else
                {
                    updateAddress(currNavId);
                }
            }
            else
            {
                hasSub = false;
                buildLongTitle(myXML.project.longTitle);
                shortTitle = myXML.project.shortTitle;
                navList = new XMLList(myXML.project.tier0.tier1.@label);
                buildNav(navList);
                switchShells(currNavId);
            }
            return;
        }

        function childBtnClick(event:MouseEvent) : void
        {
            trace("childBtnClick " + childBtnClick);
            oldNavId = currNavId;
            currNavId = event.currentTarget.idNum;
            updateAddress(currNavId);
            return;
        }

        function buildSubNav(param1:XMLList) : void
        {
            var i:int;
            var incomingList:* = param1;
            navList = incomingList;
            navListLength = navList.length();
            subBtnsArray = new Array();
            colsArray = new Array();
            shellsArray = new Array();
            shellsArray.length = navListLength;
            i;
            while (i < navListLength)
            {
                
                subBtnsArray[i] = new NavItem(myRoot, navList[i], "", i);
                subBtnsArray[i].addEventListener(MouseEvent.MOUSE_OVER, subBtnRollOver, false, 0, true);
                subBtnsArray[i].addEventListener(MouseEvent.MOUSE_OUT, subBtnRollOut, false, 0, true);
                subBtnsArray[i].addEventListener(MouseEvent.CLICK, subBtnClick, false, 0, true);
                subBtnsArray[i].alpha = 0;
                addChild(subBtnsArray[i]);
                TweenMax.to(subBtnsArray[i], fadeSpeed, {alpha:1, overwrite:true});
                if (navList[i] != "Related")
                {
                    shellsArray[i] = new Array([]);
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project[i].tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label != "Related")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    colsArray.push(buildSubNavChildCol(_loc_3.@label));
                    shellsArray[i].length = colsArray[i].length;
                }
                else
                {
                    shellsArray[i] = new Array([""]);
                }
                i = (i + 1);
            }
            if (myRoot.localPagesXML.page.@id.contains(projId))
            {
                subBtnsArray[navListLength] = new BookmarkNavItem(myRoot, "Bookmark", "", navListLength, true);
            }
            else
            {
                subBtnsArray[navListLength] = new BookmarkNavItem(myRoot, "Bookmark", "", navListLength, false);
            }
            subBtnsArray[navListLength].addEventListener(MouseEvent.MOUSE_OVER, subBtnRollOver, false, 0, true);
            subBtnsArray[navListLength].addEventListener(MouseEvent.MOUSE_OUT, subBtnRollOut, false, 0, true);
            subBtnsArray[navListLength].addEventListener(MouseEvent.CLICK, subBtnClick, false, 0, true);
            subBtnsArray[navListLength].alpha = 0;
            addChild(subBtnsArray[navListLength]);
            TweenMax.to(subBtnsArray[navListLength], fadeSpeed, {alpha:1, overwrite:true});
            doResize();
            updateAddress(currNavId);
            return;
        }

        function buildNav(param1:XMLList) : void
        {
            var _loc_2:int = 0;
            navList = param1;
            navListLength = navList.length();
            if (navListLength > 8)
            {
                navListLength = 8;
            }
            btnsArray = new Array();
            shellsArray = new Array();
            shellsArray.length = navListLength;
            _loc_2 = 0;
            while (_loc_2 < navListLength)
            {
                
                btnsArray[_loc_2] = new NavItem(myRoot, navList[_loc_2], "", _loc_2);
                btnsArray[_loc_2].addEventListener(MouseEvent.MOUSE_OVER, btnRollOver, false, 0, true);
                btnsArray[_loc_2].addEventListener(MouseEvent.MOUSE_OUT, btnRollOut, false, 0, true);
                btnsArray[_loc_2].addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
                btnsArray[_loc_2].alpha = 0;
                addChild(btnsArray[_loc_2]);
                TweenMax.to(btnsArray[_loc_2], fadeSpeed, {alpha:1, overwrite:true});
                _loc_2++;
            }
            if (myRoot.localPagesXML.page.@id.contains(projId))
            {
                btnsArray[navListLength] = new BookmarkNavItem(myRoot, "Bookmark", "", navListLength, true);
            }
            else
            {
                btnsArray[navListLength] = new BookmarkNavItem(myRoot, "Bookmark", "", navListLength, false);
            }
            btnsArray[navListLength].addEventListener(MouseEvent.MOUSE_OVER, btnRollOver, false, 0, true);
            btnsArray[navListLength].addEventListener(MouseEvent.MOUSE_OUT, btnRollOut, false, 0, true);
            btnsArray[navListLength].addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
            btnsArray[navListLength].alpha = 0;
            addChild(btnsArray[navListLength]);
            TweenMax.to(btnsArray[navListLength], fadeSpeed, {alpha:1, overwrite:true});
            return;
        }

        function imageBtnClickListener(event:ImageBtnClickEvent) : void
        {
            var _loc_2:int = 0;
            _loc_2 = 0;
            if (navList.contains("Photography"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Photography")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Renderings"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Renderings")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Models"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Models")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Sketches"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Sketches")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Drawings"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Drawings")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Construction"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Construction")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            else if (navList.contains("Video"))
            {
                _loc_2 = 0;
                while (_loc_2 < navList.length())
                {
                    
                    if (navList[_loc_2] == "Construction")
                    {
                        updateAddress(_loc_2);
                        break;
                    }
                    _loc_2++;
                }
            }
            return;
        }

        function btnClick(event:MouseEvent) : void
        {
            if (event.currentTarget.idNum == navListLength)
            {
                updateBookmark();
            }
            else
            {
                updateAddress(event.currentTarget.idNum);
            }
            return;
        }

        public function loadChildShells(param1, param2) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            _loc_3 = 0;
            while (_loc_3 < shellsArray.length)
            {
                
                _loc_4 = 0;
                while (_loc_4 < shellsArray[_loc_3].length)
                {
                    
                    if (_loc_3 == param1 && _loc_4 == param2)
                    {
                        if (shellsArray[_loc_3][_loc_4] != null && shellsArray[_loc_3][_loc_4] != undefined && shellsArray[_loc_3][_loc_4] != "" && navList[param1] != "Related")
                        {
                            shellsArray[_loc_3][_loc_4].visible = true;
                            if (colsArray[param1][param2].field.text == "Info" || colsArray[param1][param2].field.text == "Credits")
                            {
                                shellsArray[_loc_3][_loc_4].coverSprite.visible = false;
                                shellsArray[_loc_3][_loc_4].coverSprite.alpha = 0;
                            }
                            shellsArray[_loc_3][_loc_4].fadeInShell();
                        }
                        else
                        {
                            createNewSubShell(_loc_3, _loc_4);
                        }
                    }
                    else if (shellsArray[_loc_3][_loc_4] != null && shellsArray[_loc_3][_loc_4] != undefined && shellsArray[_loc_3][_loc_4] != "")
                    {
                        trace(shellsArray[_loc_3][_loc_4] + " fadeOutShell()");
                        shellsArray[_loc_3][_loc_4].fadeOutShell();
                    }
                    _loc_4++;
                }
                _loc_3++;
            }
            return;
        }

        function updateAddress(param1) : void
        {
            switch(myRoot.pathNames[1])
            {
                case "architecture":
                {
                    switch(myRoot.pathNames[2])
                    {
                        case "name":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "type":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "date":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "location":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], myRoot.pathNames[6], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + myRoot.pathNames[6] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], myRoot.pathNames[6], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + myRoot.pathNames[6] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "visual":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "icons":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                    break;
                }
                case "products":
                {
                    switch(myRoot.pathNames[2])
                    {
                        case "name":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "type":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "date":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "visual":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                    break;
                }
                case "exhibitions":
                {
                    switch(myRoot.pathNames[2])
                    {
                        case "name":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "date":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "location":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], myRoot.pathNames[6], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + myRoot.pathNames[6] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], myRoot.pathNames[5], myRoot.pathNames[6], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + myRoot.pathNames[5] + "/" + myRoot.pathNames[6] + "/" + param1 + "/");
                            }
                            break;
                        }
                        case "visual":
                        {
                            if (hasSub == true)
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], "sub", currSubNavId, param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + "sub" + "/" + currSubNavId + "/" + param1 + "/");
                            }
                            else
                            {
                                myRoot.clickPathNames = [myRoot.pathNames[0], myRoot.pathNames[1], myRoot.pathNames[2], myRoot.pathNames[3], myRoot.pathNames[4], param1];
                                myRoot.updateAddress("/" + myRoot.pathNames[0] + "/" + myRoot.pathNames[1] + "/" + myRoot.pathNames[2] + "/" + myRoot.pathNames[3] + "/" + myRoot.pathNames[4] + "/" + param1 + "/");
                            }
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        function createNewShell(param1:int) : void
        {
            var showBorder:Boolean;
            var incomingId:* = param1;
            switch(String(navList[incomingId]))
            {
                case "Info":
                {
                    if (myXML.project.thumbnails.@mBorder == "1")
                    {
                        showBorder;
                    }
                    else
                    {
                        showBorder;
                    }
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Info")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_3, myXML.project.thumbnails.@main, showBorder);
                    if (!navList.contains("Photography") && !navList.contains("Renderings") && !navList.contains("Models") && !navList.contains("Sketches") && !navList.contains("Drawings") && !navList.contains("Construction") && !navList.contains("Video"))
                    {
                        projDescShell.showBtn = false;
                    }
                    shellsArray[incomingId] = projDescShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListener, false, 0, true);
                    break;
                }
                case "Credits":
                {
                    if (myXML.project.thumbnails.@mBorder == "1")
                    {
                        showBorder;
                    }
                    else
                    {
                        showBorder;
                    }
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Credits")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    projDescShell = new ProjDescShell(myRoot, fadeSpeed, _loc_3, myXML.project.thumbnails.@main, showBorder);
                    if (!navList.contains("Photography") && !navList.contains("Renderings") && !navList.contains("Models") && !navList.contains("Sketches") && !navList.contains("Drawings") && !navList.contains("Construction") && !navList.contains("Video"))
                    {
                        projDescShell.showBtn = false;
                    }
                    shellsArray[incomingId] = projDescShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    projDescShell.addEventListener(ImageBtnClickEvent.CLICKED, imageBtnClickListener, false, 0, true);
                    break;
                }
                case "Construction":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Construction")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = multiImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Models":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Models")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = multiImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Photography":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Photography")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = multiImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Renderings":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Renderings")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = multiImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Silkscreens":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Silkscreens")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    multiImgShell = new ProjMultiImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = multiImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Drawings":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Drawings")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    standardImgShell = new ProjStandardImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = standardImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Sketches":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Sketches")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    standardImgShell = new ProjStandardImgShell(myRoot, fadeSpeed, _loc_3.image, myXML.project[0].@id);
                    shellsArray[incomingId] = standardImgShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Video":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Video")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    projVidThumbShell = new ProjVidThumbShell(myRoot, fadeSpeed, _loc_3.video);
                    shellsArray[incomingId] = projVidThumbShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    break;
                }
                case "Related":
                {
                    var _loc_4:int = 0;
                    var _loc_5:* = myXML.project.tier0.tier1;
                    var _loc_3:* = new XMLList("");
                    for each (_loc_6 in _loc_5)
                    {
                        
                        var _loc_7:* = _loc_5[_loc_4];
                        with (_loc_5[_loc_4])
                        {
                            if (@label == "Related")
                            {
                                _loc_3[_loc_4] = _loc_6;
                            }
                        }
                    }
                    relatedShell = new ProjRelatedShell(myRoot, fadeSpeed, _loc_3.item);
                    shellsArray[incomingId] = relatedShell;
                    shellsArray[incomingId].alpha = 0;
                    addChild(shellsArray[incomingId]);
                    doResize();
                    shellsArray[incomingId].fadeInShell();
                    myRoot.menuShell.hRule3On();
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        function xmlLoad() : void
        {
            xmlLoader = new XMLLoader();
            xmlLoader.addEventListener(XMLProgressEvent.PROGRESS, xmlProgress, false, 0, true);
            xmlLoader.addEventListener(XMLInitEvent.INIT_COMPLETE, xmlInit, false, 0, true);
            xmlLoader.load(myRoot.path + "flash_support/project_xml.php?id=" + projId);
            return;
        }

        public function updateChildShells(param1:int, param2:int) : void
        {
            return;
        }

    }
}
